package org.mch.func.m_px.yunsf;

import java.awt.Color;
import java.awt.Font;

import javax.swing.JLabel;
import javax.swing.border.LineBorder;

import org.mch.biz.ui.BizEvent;
import org.mch.biz.ui.BizPanel;
import org.mch.swingm.core.MButton;
import org.mch.swingm.ext.METextField;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JButton;

/**
 * 描述：；<BR/>
 * 
 * @author MCH；<BR/>
 *
 */
public class AnWeiYiHuo_Panel extends BizPanel {
	private static final long serialVersionUID = -7257264436469588275L;
	private METextField text_int_a;
	private METextField text_ia_buma;
	private MButton btn_js_erjinzhi;
	private MButton btn_erjinzhi_yihuo;
	private METextField text_ib_fanma;
	private JLabel label;
	private JLabel label_1;
	private METextField text_int_yihuo;
	private MButton btn_int_yihuo;
	private JLabel label_2;
	private JLabel lbljava;
	private JLabel label_3;
	private JLabel label_4;
	private JLabel label_5;
	private JLabel label_6;
	private METextField text_ib_yuanma;
	private MButton btn_YuanmaToFanma;
	private MButton btn_FanmaToBuma;
	private JScrollPane scrollPane;
	private JTextArea textArea;
	private MButton btn_FanmaToYuanma;
	private MButton btn_BumaToFanma;
	private JButton btn_clear;
	private METextField text_int_b;
	private METextField text_ib_buma;
	private METextField text_ia_fanma;
	private METextField text_ia_yuanma;

	public AnWeiYiHuo_Panel() {

		initGUI();
	}

	private void initGUI() {
		setLayout(null);
		add(getText_int_a());
		add(getText_ia_buma());
		add(getBtn_js_erjinzhi());
		add(getBtn_erjinzhi_yihuo());
		add(getText_ib_fanma());
		add(getLabel());
		add(getLabel_1());
		add(getText_int_yihuo());
		add(getBtn_int_yihuo());
		add(getLabel_2());
		add(getLbljava());
		add(getLabel_3());
		add(getLabel_4());
		add(getLabel_5());
		add(getLabel_6());
		add(getText_ib_yuanma());
		add(getBtn_YuanmaToFanma());
		add(getBtn_FanmaToBuma());
		add(getScrollPane());
		add(getBtn_FanmaToYuanma());
		add(getBtn_BumaToFanma());
		add(getText_int_b());
		add(getText_ib_buma());
		add(getText_ia_fanma());
		add(getText_ia_yuanma());
	}

	public METextField getText_int_a() {
		if (text_int_a == null) {
			text_int_a = new METextField();
			text_int_a.getLabel().setText("异或数A：");
			text_int_a.setBounds(12, 127, 142, 25);
			text_int_a.setTextType("int");
		}
		return text_int_a;
	}

	public METextField getText_ia_buma() {
		if (text_ia_buma == null) {
			text_ia_buma = new METextField();
			text_ia_buma.getLabel().setText("数A二进制补码：");
			text_ia_buma.setBounds(12, 164, 379, 25);
		}
		return text_ia_buma;
	}

	public MButton getBtn_js_erjinzhi() {
		if (btn_js_erjinzhi == null) {
			btn_js_erjinzhi = new MButton();
			btn_js_erjinzhi.setText("计算二进制");
			btn_js_erjinzhi.setBounds(403, 164, 98, 25);
			btn_js_erjinzhi.addMouseListener(getEvent());
		}
		return btn_js_erjinzhi;
	}

	public MButton getBtn_erjinzhi_yihuo() {
		if (btn_erjinzhi_yihuo == null) {
			btn_erjinzhi_yihuo = new MButton();
			btn_erjinzhi_yihuo.setText("二进制异或结果");
			btn_erjinzhi_yihuo.setBounds(12, 351, 126, 25);
			btn_erjinzhi_yihuo.addMouseListener(getEvent());
		}
		return btn_erjinzhi_yihuo;
	}

	@Override
	protected BizEvent createEvent() {
		return new AnWeiYiHuo_Event(this);
	}

	public METextField getText_ib_fanma() {
		if (text_ib_fanma == null) {
			text_ib_fanma = new METextField();
			text_ib_fanma.getLabel().setText("数B二进制反码：");
			text_ib_fanma.setBounds(12, 244, 379, 25);
		}
		return text_ib_fanma;
	}

	public JLabel getLabel() {
		if (label == null) {
			label = new JLabel("1、符号位：0为正数，1为负数。");
			label.setForeground(Color.RED);
			label.setBorder(new LineBorder(new Color(192, 192, 192), 2));
			label.setFont(new Font("宋体", Font.PLAIN, 12));
			label.setBounds(12, 12, 245, 25);
		}
		return label;
	}

	public JLabel getLabel_1() {
		if (label_1 == null) {
			label_1 = new JLabel("2、正数的原码、反码、补码为其本身。");
			label_1.setForeground(Color.RED);
			label_1.setBorder(new LineBorder(Color.LIGHT_GRAY, 2));
			label_1.setFont(new Font("宋体", Font.BOLD, 12));
			label_1.setBounds(12, 42, 245, 25);
		}
		return label_1;
	}
	public METextField getText_int_yihuo() {
		if (text_int_yihuo == null) {
			text_int_yihuo = new METextField();
			text_int_yihuo.getLabel().setText("^ 直接异或结果为：");
			text_int_yihuo.setTextType("int");
			text_int_yihuo.setBounds(320, 127, 204, 25);
		}
		return text_int_yihuo;
	}
	public MButton getBtn_int_yihuo() {
		if (btn_int_yihuo == null) {
			btn_int_yihuo = new MButton();
			btn_int_yihuo.setText("^异或");
			btn_int_yihuo.setBounds(536, 127, 57, 25);
			btn_int_yihuo.addMouseListener(getEvent());
		}
		return btn_int_yihuo;
	}
	public JLabel getLabel_2() {
		if (label_2 == null) {
			label_2 = new JLabel("3、负数的反码是在其原码的基础上, 符号位不变，其余各个位取反。");
			label_2.setForeground(Color.RED);
			label_2.setFont(new Font("宋体", Font.PLAIN, 12));
			label_2.setBorder(new LineBorder(new Color(192, 192, 192), 2));
			label_2.setBounds(269, 12, 379, 25);
		}
		return label_2;
	}
	public JLabel getLbljava() {
		if (lbljava == null) {
			lbljava = new JLabel("4、Java中数都是有符号数。");
			lbljava.setForeground(Color.RED);
			lbljava.setFont(new Font("宋体", Font.PLAIN, 12));
			lbljava.setBorder(new LineBorder(Color.LIGHT_GRAY, 2));
			lbljava.setBounds(269, 42, 379, 25);
		}
		return lbljava;
	}
	public JLabel getLabel_3() {
		if (label_3 == null) {
			label_3 = new JLabel("5、负数的反码=它的原码符号位不变, 其他位取反。");
			label_3.setForeground(Color.RED);
			label_3.setFont(new Font("宋体", Font.PLAIN, 12));
			label_3.setBorder(new LineBorder(Color.LIGHT_GRAY, 2));
			label_3.setBounds(12, 72, 379, 25);
		}
		return label_3;
	}
	public JLabel getLabel_4() {
		if (label_4 == null) {
			label_4 = new JLabel("6、负数的补码=它的反码+1。");
			label_4.setForeground(Color.RED);
			label_4.setFont(new Font("宋体", Font.PLAIN, 12));
			label_4.setBorder(new LineBorder(new Color(192, 192, 192), 2));
			label_4.setBounds(403, 72, 245, 25);
		}
		return label_4;
	}
	public JLabel getLabel_5() {
		if (label_5 == null) {
			label_5 = new JLabel("8、0的反码, 补码都是0。");
			label_5.setForeground(Color.RED);
			label_5.setFont(new Font("宋体", Font.PLAIN, 12));
			label_5.setBorder(new LineBorder(new Color(192, 192, 192), 2));
			label_5.setBounds(403, 98, 245, 25);
		}
		return label_5;
	}
	public JLabel getLabel_6() {
		if (label_6 == null) {
			label_6 = new JLabel("7、在计算机运算的时候, 都是以补码的方式来运算的。");
			label_6.setForeground(Color.RED);
			label_6.setFont(new Font("宋体", Font.BOLD, 12));
			label_6.setBorder(new LineBorder(Color.LIGHT_GRAY, 2));
			label_6.setBounds(12, 98, 379, 25);
		}
		return label_6;
	}
	public METextField getText_ib_yuanma() {
		if (text_ib_yuanma == null) {
			text_ib_yuanma = new METextField();
			text_ib_yuanma.getLabel().setText("数B二进制原码：");
			text_ib_yuanma.setBounds(12, 297, 379, 25);
		}
		return text_ib_yuanma;
	}
	public MButton getBtn_YuanmaToFanma() {
		if (btn_YuanmaToFanma == null) {
			btn_YuanmaToFanma = new MButton();
			btn_YuanmaToFanma.setText("原码To反码");
			btn_YuanmaToFanma.setBounds(12, 381, 126, 25);
			btn_YuanmaToFanma.addMouseListener(getEvent());
		}
		return btn_YuanmaToFanma;
	}
	public MButton getBtn_FanmaToBuma() {
		if (btn_FanmaToBuma == null) {
			btn_FanmaToBuma = new MButton();
			btn_FanmaToBuma.setText("反码To补码");
			btn_FanmaToBuma.setBounds(12, 409, 126, 25);
			btn_FanmaToBuma.addMouseListener(getEvent());
		}
		return btn_FanmaToBuma;
	}
	public JScrollPane getScrollPane() {
		if (scrollPane == null) {
			scrollPane = new JScrollPane();
			scrollPane.setBounds(150, 351, 498, 226);
			scrollPane.setViewportView(getTextArea());
			scrollPane.setColumnHeaderView(getBtn_clear());
		}
		return scrollPane;
	}
	public JTextArea getTextArea() {
		if (textArea == null) {
			textArea = new JTextArea();
			textArea.setBorder(new LineBorder(Color.WHITE, 2));
			textArea.setFont(new Font("宋体", Font.PLAIN, 13));
		}
		return textArea;
	}
	public MButton getBtn_FanmaToYuanma() {
		if (btn_FanmaToYuanma == null) {
			btn_FanmaToYuanma = new MButton();
			btn_FanmaToYuanma.setText("反码To原码");
			btn_FanmaToYuanma.setBounds(12, 437, 126, 25);
			btn_FanmaToYuanma.addMouseListener(getEvent());
		}
		return btn_FanmaToYuanma;
	}
	public MButton getBtn_BumaToFanma() {
		if (btn_BumaToFanma == null) {
			btn_BumaToFanma = new MButton();
			btn_BumaToFanma.setText("补码To反码");
			btn_BumaToFanma.setBounds(12, 465, 126, 25);
			btn_BumaToFanma.addMouseListener(getEvent());
		}
		return btn_BumaToFanma;
	}
	public JButton getBtn_clear() {
		if (btn_clear == null) {
			btn_clear = new JButton("清空");
			btn_clear.setFont(new Font("宋体", Font.BOLD, 12));
			btn_clear.addMouseListener(getEvent());
		}
		return btn_clear;
	}
	public METextField getText_int_b() {
		if (text_int_b == null) {
			text_int_b = new METextField();
			text_int_b.getLabel().setText("异或数B：");
			text_int_b.setTextType("int");
			text_int_b.setBounds(166, 127, 142, 25);
		}
		return text_int_b;
	}
	public METextField getText_ib_buma() {
		if (text_ib_buma == null) {
			text_ib_buma = new METextField();
			text_ib_buma.getLabel().setText("数B二进制补码：");
			text_ib_buma.setBounds(12, 190, 379, 25);
		}
		return text_ib_buma;
	}
	public METextField getText_ia_fanma() {
		if (text_ia_fanma == null) {
			text_ia_fanma = new METextField();
			text_ia_fanma.getLabel().setText("数A二进制反码：");
			text_ia_fanma.setBounds(12, 216, 379, 25);
		}
		return text_ia_fanma;
	}
	public METextField getText_ia_yuanma() {
		if (text_ia_yuanma == null) {
			text_ia_yuanma = new METextField();
			text_ia_yuanma.getLabel().setText("数A二进制原码：");
			text_ia_yuanma.setBounds(12, 270, 379, 25);
		}
		return text_ia_yuanma;
	}
}
